package marmalius.command.admin;

import marmalius.Player;
import marmalius.command.BaseCommand;
import marmalius.tools.Config;

public class AddCoin extends BaseCommand {
	public void process(Player player, String[] command) {
		if (command == null || command.length < 1) {
			showHelp(player);
			return ;
		}
		
		int count = ParseInteger(command[0]);
		if (count > 0)
			player.getInventory().addItem(Config.COINID, count);
		else if (count < 0)
			player.getInventory().removeItem(Config.COINID, -count);
		
		player.sendPlayerMessage("You have " + player.getInventory().getCoinCount() + " coin(s)");
	}
}
